50a7fd
@@ -83,7 +83,7 @@
public BoundedInputStream(InputStream in) {
      */
     @Override
     public int read() throws IOException {
-        if (max>=0 && pos==max) {
+        if (max >= 0 && pos >= max) {
             return -1;
         }
         int result = in.read();
